Performance optimized approach for efficient numerical computations

ABSTRACT

In particular, the present invention relates to a method and system for improving the efficiency of computational processes and specifically multiply and accumulate (“MAC”) processes such as the DCT (“Discrete Cosine Transform”) and/or IDCT (“Inverse Discrete Cosine Transform”) using a performance optimized method and associated hardware apparatus.

FIELD OF THE INVENTION

[0001] The present invention relates to the areas of computation and algorithms and specifically to the areas of digital signal processing (“DSP”) and digital logic for performing DSP operations to the areas of digital signal processing, algorithms, structures and systems for performing digital signal processing. In particular, the present invention relates to a method and system for improving the efficiency of computational processes and specifically multiply and accumulate (“MAC”) processes such as the DCT (“Discrete Cosine Transform”) and/or IDCT (“Inverse Discrete Cosine Transform”) using a performance optimized method and associated hardware apparatus.

BACKGROUND INFORMATION

[0002] Digital signal processing (“DSP”) and information theory technology is essential to modem information processing and in telecommunications for both the efficient storage and transmission of data. In particular, effective multimedia communications including speech, audio and video relies on efficient methods and structures for compression of the multimedia data in order to conserve bandwidth on the transmission channel as well as to conserve storage requirements.

[0003] Many DSP algorithms rely on transform kernels such as an FFT (“Fast Fourier Transform”), DCT (“Discrete Cosine Transform”), etc. For example, the discrete cosine transform (“DCT”) has become a very widely used component in performing compression of multimedia information, in particular video information. The DCT is a loss-less mathematical transformation that converts a spatial or time representation of a signal into a frequency representation. The DCT offers attractive properties for converting between spatial/time domain and frequency representations of signals as opposed to other transforms such as the DFT (“Discrete Fourier Transform”)/FFT. In particular, the kernel of the transform is real, reducing the complexity of processor calculations that must be performed. In addition, a significant advantage of the DCT for compression is that it exhibits an energy compaction property, wherein the signal energy in the transform domain is concentrated in low frequency components, while higher frequency components are typically much smaller in magnitude, and may often be discarded. The DCT is in fact asymptotic to the statistically optimal Karhunen-Loeve transform (“KLT”) for Markov signals of all orders. Since its introduction in 1974, the DCT has been used in many applications such as filtering, transmultiplexers, speech coding, image coding (still frame, video and image storage), pattern recognition, image enhancement and SAR/IR image coding. The DCT has played an important role in commercial applications involving DSP, most notably it has been adopted by MPEG (“Motion Picture Experts Group”) for use in MPEG 2 and MPEG 4 video compression algorithms.

[0004] A computation that is common in digital filters such as finite impulse response (“FIR”) filters or linear transformations such as the DFT and DCT may be expressed mathematically by the following dot-product equation: $d = {\sum\limits_{i = 0}^{N - 1}{{a(i)}*{b(i)}}}$

[0005] where a(i) are the input data, b(i) are the filter coefficients (taps) and d is the output. Typically a multiply-accumulator (“MAC”) is employed in traditional DSP design in order to accelerate this type of computation. A MAC kernel can be described by the following equation:

d ^([i+1]) =d ^([i]) +a(i)*b(i) with initial value d ^([0])=0.

BRIEF DESCRIPTION OF THE DRAWINGS

[0006]FIG. 1a is a block diagram of a video encoding system.

[0007]FIG. 1b is a block diagram of a video decoding system.

[0008]FIG. 2 is a block diagram of a datapath for computing a 2-D IDCT.

[0009]FIG. 3 is a block diagram illustrating the operation of a MAC kernel.

[0010]FIG. 4 is a block diagram illustrating the operation of a MAAC kernel according to one embodiment of the present invention.

[0011]FIG. 5 illustrates a paradigm for improving computational processes utilizing a MAAC kernel according to one embodiment of the present invention.

[0012]FIG. 6 is a block diagram of a hardware architecture for computing an eight point IDCT utilizing a MAAC kernel according to one embodiment of the present invention.

[0013]FIG. 7 is a block diagram of a datapath for computation of an 8-point IDCT utilizing the method of the present invention and a number of MAAC kernel components according to one embodiment of the present invention.

[0014]FIG. 8 is a block diagram illustrating the operation of an AMAAC kernel according to one embodiment of the present invention.

DETAILED DESCRIPTION

[0015]FIG. 1a is a block diagram of a video encoding system. Video encoding system 123 includes DCT block 111, quantization block 113, inverse quantization block 115, IDCT block 140, motion compensation block 150, frame memory block 160, motion estimation block and VLC (“Variable Length Coder”) block 131. Input video is received in digitized form. Together with one or more reference video data from frame memory, input video is provided to motion estimation block 121, where a motion estimation process is performed. The output of motion estimation block 121 containing motion information such as motion vectors is transferred to motion compensation block 150 and VLC block 131. Using motion vectors and one or many reference video data, motion compensation block 150 performs motion compensation process to generate motion prediction results. Input video is subtracted at adder 170 a by the motion prediction results from motion compensation block 150.

[0016] The output of adder is provided to DCT block 111 where a DCT computed. The output of the DCT is provided to quantization block 113, where the frequency coefficients are quantized and then transmitted to VLC (“Variable Length Coder”) 131, where a variable length coding process (e.g., Huffinan coding) is performed. Motion information from motion estimation block 121 and quantized indices of DCT coefficients from Q block 113 are provided to VLC block 131. The output of VLC block 131 is the compressed video data output from video encoder 123 The output of quantities block 113 is also transmitted to inverse quantization block 115, where an inverse quantization process is performed.

[0017] The output of inverse quantization block is provided to IDCT block 140, where IDCT is performed. The output of IDCT block is summered at adder 107(b) with motion prediction results from motion compensation. The output of adder 170 b is reconstructed video data and is stored in the frame memory block 160 to serve as reference data for the encoding of future video data.

[0018]FIG. 1b is a block diagram of a video decoding system. Video decoding system 125 includes variable length decoder (“VLD”) block 110, inverse scan (“IS”) block 120, inverse quantization block (“IQ”) 130, IDCT block 140, frame memory block 160, motion compensation block 150 and adder 170. A compressed video bitstream is received by VLD block and decoded. The decoded symbols are converted into quantized indices of DCT coefficients and their associated sequential locations in a particular scanning order. The sequential locations are then converted into frequency-domain locations by the IS block 120. The quantized indices of DCT coefficients are converted to DCT coefficients by the IQ block 130. The DCT coefficients are received by IDCT block 140 and transformed. The output from the IDCT is then combined with the output of motion compensation block 150 by the adder 170. The motion compensation block 150 may reconstruct individual pictures based upon the changes from one picture to its reference picture(s). Data from the reference picture(s), a previous one or a future one or both, may be stored in a temporary frame memory block 160 such as a frame buffer and may be used as the references. The motion compensation block 150 uses the motion vectors decoded from the VLD 110 to determine how the current picture in the sequence changes from the reference picture(s). The output of the motion compensation block 150 is the motion prediction data. The motion prediction data is added to the output of the IDCT 140 by the adder 170. The output from the adder 170 is then clipped (not shown) to become the reconstructed video data.

[0019]FIG. 2 is a block diagram of a datapath for computing a 2-dimensional (2D) IDCT according to one embodiment of the present invention. It includes a data multiplexer 205, a 1D IDCT block 210, a data demultiplexer 207 and a transport storage unit 220. Incoming data from IQ is processed in two passes through the IDCT. In the first pass, the IDCT block is configured to perform a 1D IDCT transform along vertical direction. In this pass, data from IQ is selected by the multiplexer 210, processed by the 1D IDCT block 210. The output from IDCT block 210 is an intermediate results that are selected by the demultiplexer to be stored in the transport storage unit 220. In the second pass, IDCT block 210 is configured to perform ID IDCT along horizontal direction. As such, the intermediate data stored in the transport storage unit 220 is selected by multiplexer 205, and processed by the 1D IDCT block 210. Demultiplexer 207 outputs results from the 1D IDCT block as the final result of the 2D IDCT.

[0020] Many computational processes such as the transforms described above (i.e., DCT, IDCT, DFT, etc) and filtering operations rely upon a multiply and accumulate kernel. That is, the algorithms are effectively performed utilizing one or more multiply and accumulate components typically implemented as specialized hardware on a DSP or other computer chip. The commonality of the MAC nature of these processes has resulted in the development of particular digital logic and circuit structures to carry out multiply and accumulate processes. In particular, a fundamental component of any DSP chip today is the MAC unit.

[0021]FIG. 3 is a block diagram illustrating the operation of a MAC kernel. Multiplier 310 performs multiplication of input datum a(i) and filter coefficient b(i), the result of which is passed to adder 320. Adder 320 adds the result of multiplier 310 to accumulated output d^([1]) which was previously stored in register 330. The output of adder 320 (d^([i+1])) is then stored in register 330. Typically a MAC output is generated on each clock cycle.

[0022] The present invention provides a method and system for optimized numerical computations. The present invention is particularly suitable for multiply accumulate processes such as transforms, linear filtering operations, etc. One embodiment described herein relates to the application of the invention to a more efficient IDCT computation. The present invention may also be applied to the DFT, DCT, FFT and/or other multiply and accumulate processes such as those typically utilized in performing transforms. An embodiment described herein relates to the application of the MAAC architecture to calculation of the IDCT. However, the present invention may be applied in any multiply accumulate process such as a DCT, DFT, digital filter, etc. and the embodiments described herein are not intended to limit the scope of the claims appended hereto.

[0023] In particular, the present invention provides for efficient computation of a class of expressions of the form $d = {\sum\limits_{i = 0}^{N - 1}{{a(i)}*{{b(i)}.}}}$

[0024] In order to improve the efficiency of this class of computation, the invention utilizes a new computational architecture herein referred to as the MAAC architecture, and an AMAAC architecture, which provides for more efficient execution of this class of computational processes.

[0025] According to one embodiment, the present invention provides a method and system for efficient and optimized DCT/IDCT computations by capitalizing upon the novel algorithm realized through two new architectural component kernels specifically adopted for performing DSP operations such as the DCT and IDCT, In particular, the present invention provides a MAAC (“Multiply-Add-Accumulator”) and AMAAC (“Add-Multiply-Add-Accumulator”) kernel, which specifically capitalize upon the new algorithm described above.

[0026] The present invention provides a new accumulator architecture, herein referred to as the MAAC kernel. The MAAC kernel can be described by the following recursive equation:

d ^([i+1]) =d ^([i]) +a(i)*b(i)+c(i) with initial value d ^([0])=0.

[0027]FIG. 4 is a block diagram illustrating the operation of a MAAC kernel according to one embodiment of the present invention. MAAC kernel 405 includes multiplier 310, adder 320 and register 330. Multiplier 310 performs multiplication of input datum a(i) and filter coefficient b(i), the result of which is passed to adder 320. Adder 320 adds the result of multiplier 310 to a second input term c(i) along with accumulated output d^([i]), which was previously stored in register 330. The output of adder 320 (d^([i+1])) is then stored in register 330.

[0028] As an additional addition (c(i)) is performed each cycle, the MAAC kernel will have higher performance throughput for some class of computations. For example, the throughput of a digital filter with some filter coefficients equal to one can be improved utilizing the MAAC architecture depicted in FIG. 4.

[0029]FIG. 5 illustrates a paradigm for improving computational processes utilizing a MAAC kernel according to one embodiment of the present invention. In 510, an expression for a particular computation is determined. Typically, the computation is expressed as a linear combination of input elements a(i) scaled by a respective coefficient b(i). That is, the present invention provides for improved efficiency of performance for computational problems that may be expressed in the general form: $d = {\sum\limits_{i = 0}^{N - 1}{{a(i)}*{b(i)}}}$

[0030] where a(i) are the input data, b(i) are coefficients and d is the output. As noted above, utilizing a traditional MAC architecture, output d may be computed utilizing a kernel of the form:

d ^([i+1]) =d ^([i]) +a(i)*b(i) with initial value d ^([0])=0.

[0031] This type of computation occurs very frequently in many applications including digital signal processing, digital filtering etc.

[0032] In 520, a common factor ‘c’ is factored out of the expression obtaining the following expression: $d = {{c{\sum\limits_{i = 0}^{N - 1}{{a(i)}*{b^{\prime}(i)}\quad {where}\quad {b(i)}}}} = {{{cb}^{\prime}(i)}.}}$

[0033] If as a result of factoring the common factor c, some of the coefficients b′(i) are unity, then the following result is obtained. $d = {{c\left( {{\sum\limits_{i = 0}^{N - 1}{{a(i)}*{b^{\prime}(i)}}} + {\sum\limits_{i = M}^{N - 1}{a(i)}}} \right)}\quad {where}\quad \left\{ {{b^{\prime}(i)} = {1:{M \leq i \leq {N - 1}}}} \right\}}$

[0034] This may be effected, for example, by factoring a matrix expression such that certain matrix entries are ‘1’. The above expression lends itself to use of the MAAC kernel described above by the recursive equation:

d ^([i+1]) =d ^([i]) +a(i)*b(i)+c(i) with initial value d ^([0])=0.

[0035] In this form the computation utilizes at least one addition per cycle due to the unity coefficients.

[0036] In step 530, based upon the re-expression of the computational process accomplished in step 510, one or more MAAC kernels are arranged in a configuration to carry out the computational process as represented in its re-expressed form of step 520.

[0037] The paradigm depicted in FIG. 5 is particularly useful for multiply and accumulate computational processes. According to one embodiment, described herein, the method of the present invention is applied to provide a more efficient IDCT computation, which is a multiply and accumulate process typically carried out using a plurality of MAC kernels. However, the present invention may be applied to any type of computational process, not only MAC processes.

[0038] According to one embodiment, the present invention is applied to the IDCT in order to reduce computational complexity and improve efficiency. According to the present invention, the number of clock cycles required in a particular hardware implementation to carry out the IDCT is reduced significantly by application of the present invention.

[0039] The 2-D DCT may be expressed as follows: $y_{kl} = {\sqrt{\frac{2}{M}}{a(k)}\sqrt{\frac{2}{N}}{a(l)}{\sum\limits_{i = 0}^{M - 1}{\sum\limits_{j = 0}^{N - 1}{x_{ij}{\cos \left( \frac{\left( {{2i} + 1} \right)k\quad \pi}{2M} \right)}{\cos \left( \frac{\left( {{2j} + 1} \right)l\quad \pi}{2N} \right)}}}}}$ ${{where}\quad {a(k)}} = \begin{Bmatrix} {\frac{1}{\sqrt{2}},{{{if}\quad k} = 0}} \\ {1\quad {otherwise}} \end{Bmatrix}$

[0040] The 2-D IDCT may be expressed as follows: $x_{ij} = {\sum\limits_{k = 0}^{M - 1}{\sum\limits_{l = 0}^{N - 1}{y_{kl}\sqrt{\frac{2}{M}}{a(k)}\sqrt{\frac{2}{N}}{a(l)}{\cos \left( \frac{\left( {{2i} + 1} \right)k\quad \pi}{2M} \right)}{\cos \left( \frac{\left( {{2j} + 1} \right)l\quad \pi}{2N} \right)}}}}$ ${{where}\quad {a(k)}} = \begin{Bmatrix} {\frac{1}{\sqrt{2}},{{{if}\quad k} = 0}} \\ {1\quad {otherwise}} \end{Bmatrix}$

[0041] The 2-D DCT and IDCT are separable and may be factored as follows: ${x_{ij} = {{\sum\limits_{k = 0}^{M - 1}{z_{kj}{e_{i,M}(k)}\quad {for}\quad i}} = 0}},1,\ldots \quad,{{M\text{-}1\quad {and}\quad j} = 0},1,\ldots \quad,{N\text{-}1}$

[0042] where the temporal 1-D IDCT data are: ${z_{kj} = {{\sum\limits_{l = 0}^{N - 1}{y_{kl}{e_{j,N}(l)}\quad {for}\quad k}} = 0}},1,\ldots \quad,{{M\text{-}1\quad {and}\quad j} = 0},1,\ldots \quad,{N\text{-}1}$

[0043] and the DCT basis vectors e_(i)(m) are: ${{e_{i,M}(k)} = {\sqrt{\frac{2}{M}}{a(k)}{\cos \left( \frac{\left( {{2i} + 1} \right)l\quad \pi}{2M} \right)}\quad {for}\quad i}},{k = 0},1,\ldots \quad,{M\text{-}1}$

[0044] A fast algorithm for calculating the IDCT (Chen) capitalizes of the cyclic property of the transform basis function (the cosine function). For example, for an eight point IDCT, the basis function only assumes 8 different positive and negative values as shown in the following table: j/1 0 1 2 3 4 5 6 7 0 c(0)  c(1)  c(2)  c(3)  c(4)  c(5)  c(6)  c(7) 1 c(0)  c(3)  c(6) -c(7) -c(4) -c(1) -c(2) -c(5) 2 c(0)  c(5) -c(6) -c(1) -c(4)  c(7)  c(2)  c(3) 3 c(0)  c(7) -c(2) -c(5)  c(4)  c(3) -c(6) -c(1) 4 c(0) -c(7) -c(2)  c(5)  c(4) -c(3) -c(6)  c(1) 5 c(0) -c(5) -c(6)  c(1) -c(4) -c(7)  c(2) -c(3) 6 c(0) -c(3)  c(6)  c(7) -c(4)  c(1) -c(2)  c(5) 7 c(0) -c(1)  c(2) -c(3)  c(4) -c(5)  c(6) -c(7)

[0045] Where c(m) is the index of the following basis terms. $\begin{matrix} {{c(m)} = \quad {{a(m)}{\cos \left( \frac{m\quad \pi}{16} \right)}}} \\ {= \quad \left\{ {{\cos \left( \frac{\pi}{4} \right)},{\cos \left( \frac{\pi}{16} \right)},{\cos \left( \frac{\pi}{8} \right)},{\cos \left( \frac{3\pi}{16} \right)},{\cos \left( \frac{\pi}{4} \right)},} \right.} \\ \left. \quad {{\cos \left( \frac{5\pi}{16} \right)},{\cos \left( \frac{3\pi}{8} \right)},{\cos \left( \frac{7\pi}{16} \right)}} \right\} \\ {= \quad \left\{ {{\cos \left( \frac{\pi}{4} \right)},{\cos \left( \frac{\pi}{16} \right)},{\cos \left( \frac{\pi}{8} \right)},{\cos \left( \frac{3\pi}{16} \right)},{\cos \left( \frac{\pi}{4} \right)},} \right.} \\ \left. \quad {{\sin \left( \frac{3\pi}{16} \right)},{\sin \left( \frac{\pi}{8} \right)},{\sin \left( \frac{\pi}{16} \right)}} \right\} \end{matrix}$

[0046] The cyclical nature of the IDCT shown in the above table provides the following relationship between output terms of the 1-D IDCT: $\frac{x_{i} + x_{7 - i}}{2} = {{{e_{i}(0)}y_{0}} + {{e_{i}(2)}y_{2}} + {{e_{i}(4)}y_{4}} + {{e_{i}(6)}y_{6}}}$ $\frac{x_{i} - x_{7 - i}}{2} = {{{e_{i}(1)}y_{1}} + {{e_{i}(3)}y_{3}} + {{e_{i}(5)}y_{5}} + {{e_{i}(7)}y_{7}}}$

[0047] where the basis terms e_(i)(k) have sign and value mapped to the DCT basis terms c(m) according to the relationship: ${e_{i}(k)} = {{\pm \frac{1}{2}}{c\left( {m\left( {i,k} \right)} \right)}}$

[0048] For a 4-point IDCT, the basis terms also have the symmetrical property illustrated in the above table as follows: j/1 0 1 2 3 0 C(0) C(2) C(4) C(6) 1 C(0) C(6) -C(4)  -C(2)  2 C(0) -C(6)  -C(4)  C(2) 3 C(0) -C(2)  C(4) -C(6) 

[0049] The corresponding equations are: $\frac{x_{i} + x_{3 - i}}{2} = {{{e_{i}(0)}y_{0}} + {{e_{i}(4)}y_{2}}}$ $\frac{x_{i} - x_{3 - i}}{2} = {{{e_{i}(2)}y_{1}} + {{e_{i}(6)}y_{3}}}$

[0050] Based upon the above derivation, a 1D 8-point IDCT can be represented by the following matrix vector equation: $\begin{bmatrix} x_{0} \\ x_{1} \\ x_{2} \\ x_{3} \end{bmatrix} = {{{\frac{1}{2}{A\begin{bmatrix} y_{0} \\ y_{4} \\ y_{2} \\ y_{6} \end{bmatrix}}} + {\frac{1}{2}{{B\begin{bmatrix} y_{1} \\ y_{5} \\ y_{3} \\ y_{7} \end{bmatrix}}\quad\begin{bmatrix} x_{7} \\ x_{6} \\ x_{5} \\ x_{4} \end{bmatrix}}}} = {{\frac{1}{2}{A\begin{bmatrix} y_{0} \\ y_{4} \\ y_{2} \\ y_{6} \end{bmatrix}}} - {\frac{1}{2}{B\begin{bmatrix} y_{1} \\ y_{5} \\ y_{3} \\ y_{7} \end{bmatrix}}}}}$ where: $A = \begin{bmatrix} {c(0)} & {c(4)} & {c(2)} & {c(6)} \\ {c(0)} & {- {c(4)}} & {c(6)} & {- {c(2)}} \\ {c(0)} & {- {c(4)}} & {- {c(6)}} & {c(2)} \\ {c(0)} & {c(4)} & {- {c(2)}} & {- {c(6)}} \end{bmatrix}$ $B = \begin{bmatrix} {c(1)} & {c(5)} & {c(3)} & {c(7)} \\ {c(3)} & {- {c(1)}} & {- {c(7)}} & {- {c(5)}} \\ {c(5)} & {c(7)} & {- {c(1)}} & {c(3)} \\ {c(7)} & {c(3)} & {- {c(5)}} & {- {c(1)}} \end{bmatrix}$ ${{and}\quad {c(0)}} = {{{\cos \left( \frac{\pi}{4} \right)}\quad {and}\quad {c(n)}} = {{\cos \left( \frac{n\quad \pi}{16} \right)}\quad \left( {{n = 1},2,3,4,5,{6\quad 7}} \right)}}$ ${{Note}\quad {that}\quad A^{- 1}} = {{\frac{1}{2}A^{T}\quad {and}\quad B^{- 1}} = {\frac{1}{2}B^{T}}}$

[0051] Using the paradigm depicted in FIG. 5, a common factor may be factored from the matrix equation above such that certain coefficients are unity. The unity coefficients then allow for the introduction of a number of MAAC kernels in a computational architecture, thereby reducing the number of clock cycles required to carry out the IDCT. In particular, by factoring ${c(0)} = {{c(4)} = \frac{1}{\sqrt{2}}}$

[0052] out from the matrix vector equation above, the following equation is obtained. $\begin{bmatrix} x_{0} \\ x_{1} \\ x_{2} \\ x_{3} \end{bmatrix} = {{{\frac{1}{2}{A^{\prime}\begin{bmatrix} y_{0} \\ y_{4} \\ y_{2} \\ y_{6} \end{bmatrix}}} + {\frac{1}{2}{{B^{\prime}\begin{bmatrix} y_{1} \\ y_{5} \\ y_{3} \\ y_{7} \end{bmatrix}}\quad\begin{bmatrix} x_{7} \\ x_{6} \\ x_{5} \\ x_{4} \end{bmatrix}}}} = {{\frac{1}{2}{A^{\prime}\begin{bmatrix} y_{0} \\ y_{4} \\ y_{2} \\ y_{6} \end{bmatrix}}} - {\frac{1}{2}{B^{\prime}\begin{bmatrix} y_{1} \\ y_{5} \\ y_{3} \\ y_{7} \end{bmatrix}}}}}$ where: $A = \begin{bmatrix} 1 & 1 & {c^{\prime}(2)} & {c^{\prime}(6)} \\ 1 & {- 1} & {c^{\prime}(6)} & {- {c^{\prime}(2)}} \\ 1 & {- 1} & {- {c^{\prime}(6)}} & {c^{\prime}(2)} \\ 1 & 1 & {- {c^{\prime}(2)}} & {- {c^{\prime}(6)}} \end{bmatrix}$ $B^{\prime} = \begin{bmatrix} {c^{\prime}(1)} & {c^{\prime}(5)} & {c^{\prime}(3)} & {c^{\prime}(7)} \\ {c^{\prime}(3)} & {- {c^{\prime}(1)}} & {- {c^{\prime}(7)}} & {- {c^{\prime}(5)}} \\ {c^{\prime}(5)} & {c^{\prime}(7)} & {- {c^{\prime}(1)}} & {c^{\prime}(3)} \\ {c^{\prime}(7)} & {c^{\prime}(3)} & {- {c^{\prime}(5)}} & {- {c^{\prime}(1)}} \end{bmatrix}$

[0053] Because the factor $\frac{1}{\sqrt{2}}$

[0054] is factored out of the matrix vector equation, the results after two-dimensional operations would carry a scale factor of two. Dividing the final result by 2 after the two-dimensional computation would result in the correct transform.

[0055] Note that the expression for the IDCT derived above incorporates multiple instances of the generalized expression $d = {\sum\limits_{i = 0}^{N - 1}{{a(i)}*{b(i)}}}$

[0056] re-expressed as $d = {c\left( {{\sum\limits_{i = 0}^{M - 1}{{a(i)}*{b^{\prime}(i)}}} + {\sum\limits_{i = M}^{N - 1}{a(i)}}} \right)}$

[0057] where {b′(i)=1:M≦i≦N−1} to which the present invention is addressed. This is a consequence of the nature of matrix multiplication and may be seen as follows (unpacking the matrix multiplication):

x ₀ =y ₀ +y ₄ +c′(2)*y ₂ +c′(6)*y ₆ +c′(1)*y ₁ +c′(5)*y ₅ +c′(3)*y ₃ +c′(7)*y ₇

x ₁ =y ₀ −y ₄ +c′(6)*y ₂ −c′(2)*y ₆ +c′(3)*y ₁ −c′(1)*y ₅ −c′(7)*y ₃ −c′(5)*y ₇

x ₂ =y ₀ −y ₄ −c′(6)*y ₂ +c′(2)*y ₆ +c′(5)*y ₁ −c′(7)*y ₅ −c′(1)*y ₃ +c′(3)*y ₇

x ₃ =y ₀ +y ₄ +c′(2)*y ₂ −c′(6)*y ₆ +c′(7)*y ₁ +c′(3)*y ₅ −c′(5)*y ₃ −c′(1)*y ₇

x ₇ =y ₀ +y ₄ +c′(2)*y ₂ +c′(6)*y ₆ −c′(1)*y ₁ −c′(5)*y ₅ −c′(3)*y ₃ −c′(7)*y ₇

x ₆ =y ₀ −y ₄ +c′(6)*y ₂ −c′(2)*y ₆ −c′(3)*y ₁ +c′(1)*y ₅ +c′(7)*y ₃ +c′(5)*y ₇

x ₅ =y ₀ −y ₄ −c′(6)*y ₂ +c′(2)*y ₆ −c′(5)*y ₁ +c′(7)*y ₅ +c′(1)*y ₃ −c′(3)*y ₇

x ₄ =y ₀ +y ₄ −c′(2)*y ₂ −c′(6)*y ₆ −c′(7)*y ₁ +c′(3)*y ₅ +c′(5)*y ₃ +c′(1)*y ₇

[0058] Note that the above expressions do not incorporate scale factors ½, which can be computed at the end of the calculation simply as a right bit-shift.

[0059]FIG. 6 is a block diagram of a hardware architecture for computing an eight point IDCT utilizing a MAAC kernel according to one embodiment of the present invention. The hardware architecture of FIG. 6 may be incorporated into a larger datapath for computation of an IDCT. As shown in FIG. 6, data loader 505 is coupled to four dual MAAC kernels 405(1)-405(4), each dual MAAC kernel including two MAAC kernels sharing a common multiplier. Note that the architecture depicted in FIG. 6 is merely illustrative and is not intended to limit the scope of the claims appended hereto. The operation of the hardware architecture depicted in FIG. 5 for computing the IDCT will become evident with respect to the following discussion.

[0060] Utilizing the architecture depicted in FIG. 6, a 1-D 8-point IDCT can be computed in 5 clock cycles as follows:

[0061] 1^(st) clock:

mult1=c′(1)*y ₁

mult2=c′(3)*y ₁

mult3=c′(5)*y ₁

mult4=c′(7)*y ₁

x ₀(clk1)=y ₀+mult1+0

x ₇(clk1)=y ₀−mult1+0

x ₁(clk1)=y ₀+mult2+0

x ₆(clk1)=y ₀−mult2+0

x ₂(clk1)=y ₀+mult3+0

x ₅(clk1)=y ₀−mult3+0

x ₃(clk1)=y ₀+mult4+0

x ₄(clk1)=y ₀−mult4+0

[0062] 2nd Clock

mult1 =c′(5)*y ₅

mult2 =−c′(1)*y ₅

mult3 =−c′(7)*y ₅

mult4 =c′(3)*y ₅

x ₀(clk2)=y ₄+mult1+x ₀(clk1)

x ₇(clk2)=y ₄−mult1+x ₇(clk1)

x ₁(clk2)=−y ₄+mult2+x ₁(clk1)

x ₆(clk2)=−y ₄−mult2+x ₆(clk1)

x ₂(clk2)=−y ₄+mult3+x ₂(clk1)

x ₅(clk2)=−y ₄−mult3+x ₅(clk1)

x ₃(clk2)=y ₄+mult4+x ₃(clk1)

x ₄(clk2)=y ₄−mult4+x ₄(clk1)

[0063] 3rd Clock

mult1 =c′(3)*y ₃

mult2 =−c′(7)*y ₃

mult3 =−c′(1)*y ₃

mult4 =−c′(5)*y ₃

x ₀(clk3)=0+mult1 +x ₀(clk2)

x ₇(clk3)=0−mult1 +x ₇(clk2)

x ₁(clk3)=0+mult2 +x ₁(clk2)

x ₆(clk3)=0−mult2 +x ₆(clk2)

x ₂(clk3)=0+mult3 +x ₂(clk2)

x ₅(clk3)=0−mult3 +x ₆(clk2)

x ₃(clk3)=0+mult4 +x ₃(clk2)

x ₄(clk3)=0−mult4 +x ₄(clk2)

[0064] 4th Clock

mult1 =c′(7)*y ₇

mult2 =−c′(5)*y ₇

mult3 =c′(3)*y ₇

mult4 =−c′(1)*y ₇

x ₀(clk4)=0+mult1 +x ₀(clk3)

x ₇(clk4)=0−mult1 +x ₇(clk3)

x ₁(clk4)=0+mult2 +x ₁(clk3)

x ₆(clk4)=0−mult2 +x ₆(clk3)

x ₂(clk4)=0+mult3 +x ₂(clk3)

x ₅(clk4)=0−mult3 +x ₅(clk3)

x ₃(clk4)=0+mult4 +x ₃(clk3)

x ₄(clk4)=0−mult4 +x ₄(clk3)

[0065] 5th Clock

mult1=c′(2)*y ₂

mult2=c′(6)*y ₆

mult3=c′(6)*y ₂

mult4=−c′(2)*y ₆

x ₀(clk5)=mult2+mult1 +x ₀(clk4)

x ₇(clk5)=mult2+mult1 +x ₇(clk4)

x ₁(clk5)=mult3+mult4 +x ₁(clk4)

x ₆(clk5)=mult3+mult4 +x ₆(clk4)

x ₂(clk5)=−mult3−mult4 +x ₂(clk4)

x ₅(clk5)=−mult3−mult4 +x ₅(clk4)

x ₃(clk5)=−mult1−mult2 +x ₃(clk4)

x ₄(clk5)=−mult1−mult2 +x ₄(clk4)

[0066]FIG. 7 is a block diagram of a datapath for computation of an 8-point IDCT utilizing the method of the present invention and a number of MAAC kernel components according to one embodiment of the present invention. Note that the datapath shown in FIG. 7 includes four dual MAAC kernels 405(1)-405(4).

[0067] According to an alternative embodiment, the MAAC kernel is modified to include two additional additions, to produce a structure herein referred to as the AMAAC kernel. The AMAAC kernel can be described by the following recursive equation:

d ^([i+1]) =d ^([i]) +[a(i)+e(i)]*b(i)+c(i) with initial value d ^([0])=0.

[0068]FIG. 8 is a block diagram illustrating the operation of an AMAAC kernel according to one embodiment of the present invention. AMAAC kernel 805 includes multiplier 310, first adder 320 a, second adder 320 b and register 330. First adder 320 a adds a(i) and e(i) Multiplier 310 performs multiplication of input datum [a(i)+e(i)] and filter coefficient b(i), the result of which is passed to adder 320 b. Adder 320 b adds the result of multiplier 310 to a second input term c(i) along with accumulated output d^([i]), which was previously stored in register 330. The output of adder 320 (d^([i+1])) is then stored in register 330.

[0069] As two more additions are performed during the same AMAAC cycle, the AMAAC kernel has a higher performance throughput for some class of computations.

[0070] For example, a digital filter with some filter coefficients with equal value can take advantage (speed up) of the AMAAC kernel. Specifically, a(i), c(i), and e(i) can be considered as input data and b(i) as filter coefficients. With inputs a(i) and e(i) having the same filter coefficients b(i) and inputs c(i) with unity coefficients, all three groups of inputs can be processed in parallel.

[0071] According to one embodiment, MAAC and AMAAC computational kernels may be combined to generate a reconfigurable computation engine (for example, to compute the IDCT). By allowing this reconfiguration, hardware logic gates can be shared to improve performance with incurring additional cost. The AMMAC kernel provides a structure for achieving more efficient downsampling computations. 

What is claimed is:
 1. A method for performing a computation generally expressible in the form $d = {\sum\limits_{i = 0}^{N - 1}{{a(i)}*{b(i)}}}$

comprising: (a) determining a common factor ‘c’ such that $d = {c\left( {\sum\limits_{i = 0}^{N - 1}{{a(i)}*{b^{\prime}(i)}}} \right)}$

 wherein at least one of the b′(i)'s is unity; (b) utilizing at least one MAAC kernel to carry out the computation, wherein the at least one MAAC kernel is utilized as a function of a coefficient b′(i) being unity.
 2. The method according to claim 1, wherein the MAAC kernel includes a multiplier block, an adder block and a register block, wherein an output of the multiplier block is coupled to an input of the adder block, an output of the adder block is coupled to an input of the register block and an output of the register block is coupled to a second input of the adder block and the adder block receives at its second input an additional addend.
 3. The method according to claim 2, wherein the terms a(i) are input data terms and the terms b(i) and b′(i) are coefficients.
 4. The method according to claim 3, wherein (c) further includes if a coefficient b′(i) is unity, utilizing a MAAC kernel such that the additional addend is an input term that would be multiplied by the unity coefficient b′(i).
 5. The method according to claim 4, wherein the numerical computation is an IDCT computation.
 6. The method according to claim 5, wherein an eight-point IDCT is computed utilizing the following expression: $\begin{bmatrix} x_{0} \\ x_{1} \\ x_{2} \\ x_{3} \end{bmatrix} = {{{\frac{1}{2}{A^{\prime}\begin{bmatrix} y_{0} \\ y_{4} \\ y_{2} \\ y_{6} \end{bmatrix}}} + {\frac{1}{2}{{B^{\prime}\begin{bmatrix} y_{1} \\ y_{5} \\ y_{3} \\ y_{7} \end{bmatrix}}\quad\begin{bmatrix} x_{7} \\ x_{6} \\ x_{5} \\ x_{4} \end{bmatrix}}}} = {{\frac{1}{2}{A^{\prime}\begin{bmatrix} y_{0} \\ y_{4} \\ y_{2} \\ y_{6} \end{bmatrix}}} - {\frac{1}{2}{B^{\prime}\begin{bmatrix} y_{1} \\ y_{5} \\ y_{3} \\ y_{7} \end{bmatrix}}}}}$ where: $A^{\prime} = \begin{bmatrix} 1 & 1 & {c^{\prime}(2)} & {c^{\prime}(6)} \\ 1 & {- 1} & {c^{\prime}(6)} & {- {c^{\prime}(2)}} \\ 1 & {- 1} & {- {c^{\prime}(6)}} & {c^{\prime}(2)} \\ 1 & 1 & {- {c^{\prime}(2)}} & {- {c^{\prime}(6)}} \end{bmatrix}$ $B = \begin{bmatrix} {c^{\prime}(1)} & {c^{\prime}(5)} & {c^{\prime}(3)} & {c^{\prime}(7)} \\ {c^{\prime}(3)} & {- {c^{\prime}(1)}} & {- {c^{\prime}(7)}} & {- {c^{\prime}(5)}} \\ {c^{\prime}(5)} & {c^{\prime}(7)} & {- {c^{\prime}(1)}} & {c^{\prime}(3)} \\ {c^{\prime}(7)} & {c^{\prime}(3)} & {- {c^{\prime}(5)}} & {- {c^{\prime}(1)}} \end{bmatrix}$


7. A computational kernel for carrying out numerical computations including: a multiplier block; an adder block; a register block; wherein an output of the multiplier block is coupled to a first input of the adder block, an output of the adder block is coupled to an input of the register block and an output of the register block is coupled to a second input of the adder block, the adder block receiving a third input.
 8. The computational kernel according to claim 7, wherein the additional input provided to the adder block is an input datum associated with a unity coefficient and the multiplier block receives an input coefficient.
 9. A computational architecture kernel for carrying out numerical computations including: a multiplier block; a first adder block; a second adder block a register block; wherein the first adder block receives two inputs (e(i) and a(i)) and an output of the first adder block is coupled to a first input of the multiplier block, the multiplier block receiving a second input (b(i)) and an output of the multiplier block coupled to a first input of the second adder block, the second adder block receiving a second input (c(i)) and an output of the second adder block is coupled to an input of the register block, an output of the register block coupled to a third input of the second adder block.
 10. The computational kernel according to claim 9, wherein the two inputs to the first adder block (a(i) and e(i)) and the additional input to the second adder block (c(i)) are input data each respectively associated with a unity coefficient and the additional input to the multiplier block being a coefficient.
 11. A system for computation of an IDCT comprising: (a) a data loader block; (b) a plurality of MAAC kernels, wherein the plurality of MAAC kernels are coupled to the data loader block.
 12. The system according to claim 11, wherein each MAAC kernel includes: a multiplier block; an adder block; a register block; wherein an output of the multiplier block is coupled to a first input of the adder block, an output of the adder block is coupled to an input of the register block and an output of the register block is coupled to a second input of the adder block, the adder block receiving a third input.
 13. The system according to claim 11, wherein the plurality of MAAC kernels are arranged such that any two MAAC kernels share a common multiplier block.
 14. A system for performing a computation generally expressible in the form $d = {\sum\limits_{i = 0}^{N - 1}{{a(i)}*{b(i)}}}$

comprising: (a) a plurality of MAAC kernels, wherein each MAAC kernel includes: a multiplier block; an adder block; a register block; wherein an output of the multiplier block is coupled to a first input of the adder block, an output of the adder block is coupled to an input of the register block and an output of the register block is coupled to a second input of the adder block, the adder block receiving a third input.
 15. The system according to claim 14, wherein the general expression $d = {\sum\limits_{i = 0}^{N - 1}{{a(i)}*{b(i)}}}$

may be expressed as $d = {c\left( {\sum\limits_{i = 0}^{M - 1}{{a(i)}*{b^{\prime}(i)}}} \right)}$

where ‘c’ is a common factor and at least one of the b′(i)'s is unity.
 16. The system according to claim 14, wherein the additional input at each adder block for each of the plurality of MAAC kernels is an input term associated with a coefficient b′(i) being unity.
 17. A system for performing downsampling computations: (a) at least one AMAAC kernel, wherein each AMAAC kernel includes: a multiplier block; a first adder block; a second adder block a register block; wherein the first adder block receives two inputs (e(i) and a(i)) and an output of the first adder block is coupled to a first input of the multiplier block, the multiplier block receiving a second input (b(i)) and an output of the multiplier block coupled to a first input of the second adder block, the second adder block receiving a second input (c(i)) and an output of the second adder block is coupled to an input of the register block, an output of the register block coupled to a third input of the second adder block; (b) at least one MAAC kernel, wherein each MAAC kernel includes: a multiplier block; an adder block; a register block; wherein an output of the multiplier block is coupled to a first input of the adder block, an output of the adder block is coupled to an input of the register block and an output of the register block is coupled to a second input of the adder block, the adder block receiving a third input.
 18. The system according to claim 17, wherein the downsampling computations are performed as part of a video decoding system. 